package com.fangyi.yunmusic.controller;

import com.fangyi.yunmusic.service.ArtistService;
import com.fangyi.yunmusic.service.ArtistTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/artistTag")
public class ArtistTagController {
    @Autowired
    private ArtistTagService artistTagService;
    @PostMapping("/add")
    public Object addArtistTag(String tagName, String artistId){
        artistTagService.addArtistTag(tagName,artistId);
        return "OK";
    }
    @PostMapping("/delete")
    public Object removeArtistTag(String tagId){
        artistTagService.removeArtistTag(tagId);
        return "OK";
    }
    @GetMapping("/all")
    public Object getAllArtistTagVOs(){
        return artistTagService.getAllArtistTagVOs();
    }
    @GetMapping("/pagination")
    public Object getArtistVOsByTagId(String tagId, Integer page, Integer pageSize){
        return artistTagService.getArtistVOsByTagId(tagId,page,pageSize);
    }
}
